// Customer.java
class Customer {
    private String name;
    private int energyLevel;// 能量水平
    private double balance;
    
    public Customer(String name, double balance) {
        this.name = name;
        this.energyLevel = 20; // 初始能量水平
        this.balance = balance;
    }
    
    // Getter和Setter方法
    public String getName() {
        return name;
    }
    
    public int getEnergyLevel() {
        return energyLevel;
    }
    
    public double getBalance() {
        return balance;
    }
    
    public void setBalance(double balance) {
        this.balance = balance;
    }
    
    // 饮用咖啡方法
    public void drinkCoffee(Coffee coffee) {
        this.energyLevel += coffee.getEnergyBoost();
        if (this.energyLevel > 100) this.energyLevel = 100;
        System.out.println(name + "喝了" + coffee.getName() + "，能量值增加到" + (energyLevel-10) + "%");
    }
    
    // 支付方法
    public boolean makePayment(double amount) {
        if (balance >= amount) {
            balance -= amount;
            return true;
        } else {
            System.out.println("余额不足！当前余额: ¥" + balance);
            return false;
        }
    }

    public static Customer fromFileString(String line) {
        // TODO Auto-generated method stub
        throw new UnsupportedOperationException("Unimplemented method 'fromFileString'");
    }

    public char[] toFileString() {
        // TODO Auto-generated method stub
        throw new UnsupportedOperationException("Unimplemented method 'toFileString'");
    }
}
